package cn.memset.code.lambda;

public class SuperMethodReferenceExample {
    public static void main(String[] args) {
        ThreadWaiter waiter = new ThreadWaiter();
        waiter.run();
    }

    public static class Waiter {
        public void sayHi() {
            System.out.println("Hello, man!");
        }
    }

    public static class ThreadWaiter extends Waiter {
        @Override
        public void sayHi() {
            System.out.println("Hello, thread!");
        }

        public void run() {
            // 指定调用父类 Waiter 的 sayHi 方法
            Thread t = new Thread(super::sayHi);
            t.start();
        }
    }
}
